import _ from 'lodash';
import printMe from './print.js';
import './style.css';


function component(){
	var element = document.createElement('div');
	var btn = document.createElement('button');

	//Lodash，现在是被引入到这个js中的
	element.innerHTML = _.join(['Hello','webpack'],' ');

	btn.innerHTML = 'Click me and check the console!';
	btn.onclick = printMe;

	element.appendChild(btn);

	return element;
}
let element = component();
document.body.appendChild(element);

if(module.hot) {
	module.hot.accept('./print.js',function(){
		console.log('Accepting the updated printMe module!');
		docment.body.removeChild(element);
		element = component();
		document.body.appendChild(element);
	})
}